<?php

/**
 * This is the model class for table "asessment_result".
 *
 * The followings are the available columns in table 'asessment_result':
 * @property integer $COMP_CONTENT_ID
 * @property integer $ASSMNT_MBR_ID
 * @property integer $CHECKED
 * @property string $TIME_CREATED
 * @property string $TIME_UPDATED
 * @property integer $USER_UPDATED
 * @property integer $USER_CREATED
 */
class AsessmentResult extends CMasterModel
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return AsessmentResult the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'asessment_result';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('COMP_CONTENT_ID, ASSMNT_MBR_ID, CHECKED, USER_UPDATED, USER_CREATED', 'numerical', 'integerOnly'=>true),
			array('TIME_CREATED, TIME_UPDATED', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('COMP_CONTENT_ID, ASSMNT_MBR_ID, CHECKED, TIME_CREATED, TIME_UPDATED, USER_UPDATED, USER_CREATED', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'COMP_CONTENT_ID' => 'Comp Content',
			'ASSMNT_MBR_ID' => 'Assmnt Mbr',
			'CHECKED' => 'Checked',
			'TIME_CREATED' => 'Time Created',
			'TIME_UPDATED' => 'Time Updated',
			'USER_UPDATED' => 'User Updated',
			'USER_CREATED' => 'User Created',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('COMP_CONTENT_ID',$this->COMP_CONTENT_ID);
		$criteria->compare('ASSMNT_MBR_ID',$this->ASSMNT_MBR_ID);
		$criteria->compare('CHECKED',$this->CHECKED);
		$criteria->compare('TIME_CREATED',$this->TIME_CREATED,true);
		$criteria->compare('TIME_UPDATED',$this->TIME_UPDATED,true);
		$criteria->compare('USER_UPDATED',$this->USER_UPDATED);
		$criteria->compare('USER_CREATED',$this->USER_CREATED);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}